<%@ include file="../common/header.jsp" %>
<div class="content">
    <%@ include file="../common/top_nav.jsp" %>

    <div class="container mt-4">
        <h2>统计分析</h2>

        <!-- 住户统计 -->
        <div class="card mb-4">
            <div class="card-header">住户统计</div>
            <div class="card-body">
                <p>住户总数：<strong>${residentCount}</strong></p>
            </div>
        </div>

        <!-- 房产状态统计 -->
        <div class="card mb-4">
            <div class="card-header">房产状态统计</div>
            <div class="card-body">
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th>状态</th>
                        <th>数量</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="entry" items="${propertyStatusStats}">
                        <tr>
                            <td>${entry.key}</td>
                            <td>${entry.value}</td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>

        <!-- 费用汇总 -->
        <div class="card mb-4">
            <div class="card-header">费用汇总</div>
            <div class="card-body">
                <p>已支付总金额：<strong>￥${totalPaid}</strong></p>
                <p>未支付总金额：<strong>￥${totalUnpaid}</strong></p>
            </div>
        </div>

        <!-- 费用类型统计 -->
        <div class="card mb-4">
            <div class="card-header">各类费用统计</div>
            <div class="card-body">
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th>费用类型</th>
                        <th>总金额</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="entry" items="${feeTypeStats}">
                        <tr>
                            <td>${entry.key}</td>
                            <td>￥${entry.value}</td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<%@ include file="../common/footer.jsp" %>
